home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / machserver / tests / stderr / foo.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-03-31  |  307 b   |  18 lines

  1. /* 
  2.  * Test program to try reading from stderr.  Yeah, it's gross, but tset 
  3.  * depends on it, and it seems to work with native Sprite and Mach.
  4.  */
  5.  
  6. main()
  7. {
  8.     int i;
  9.     char buf[1024];
  10.  
  11.     while((i = read(2, buf, sizeof(buf))) > 0) {
  12.     write(1, buf, i);
  13.     }
  14.     if (i < 0) {
  15.     perror("read");
  16.     }
  17. }
  18.